package com.yincb;


import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;

/**
 * @Author yincb
 * @Date 2020/10/20 10:10
 * @Description
 */
public class Main {


    public static void main(String[] args) {

        AnnotationConfigApplicationContext ioc = new AnnotationConfigApplicationContext(MainConfig.class);
        BeanCopierWrapper beanCopierWrapper = ioc.getBean(BeanCopierWrapper.class);

        Account account = new Account();
        account.setABoolean(true);
        account.setAChar('a');
        account.setADouble(20.00);
        account.setAFloat(16.01f);
        account.setAInt(18);
        account.setALong(2000L);
        account.setBalance(BigDecimal.ONE);
        account.setDate(new Date());
        account.setLocaleData(LocalDate.now());
        account.setLocaleDataTime(LocalDateTime.now());
        account.setLocaleTime(LocalTime.now());
        account.setStr("YCB");
        AccountDto accountDto = new AccountDto();

//        beanCopierWrapper.copyPropertis(account,accountDto,true);
        beanCopierWrapper.copyPropertis(account,accountDto,false);
        System.out.println(account);
        System.out.println(accountDto);

    }


}
